﻿@{
    ViewBag.Title = "title";
    Layout = "~/Views/Shared/_Layout.cshtml";
    var Cols = new Zephyr.Models.sys_roleMenuColumnMapService().GetCurrentUserMenuColumns();
}

@section scripts{
        <script src="~/Areas/Mms/ViewModels/mms.com.js"></script>
        <script src="~/Areas/Mms/ViewModels/mms.viewModel.search.js"></script>
        <script type="text/javascript">
            var data = @Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model));
            var viewModel = function(){ 
                var self = this;
                mms.viewModel.search.apply(this,arguments);
                com.formaterPriceKind = utils.fnValueToText(data.dataSource.PriceKind);
                com.formaterPurpose = utils.fnValueToText(data.dataSource.Purpose);
            }
            ko.bindingViewModel(new viewModel(data));
        </script>
}

        @Html.RenderToolbar()

        <div id="condition" class="container_12" style="position:relative;">
            <div class="grid_1 lbl">领料单号</div>
            <div class="grid_2 val"><input type="text" data-bind="value:form.BillNo" class="z-txt easyui-autocomplete" data-options="url:'/api/mms/send/getbillno'"/></div>
            <div class="grid_1 lbl">领料单位</div>
            <div class="grid_2 val"><input type="text" data-bind="value:form.PickUnitName" class="z-txt easyui-autocomplete" data-options="url:'/api/mms/merchant/getnames'"/></div>
            <div class="grid_1 lbl">经办人</div>
            <div class="grid_2 val"><input type="text" data-bind="value:form.DoPerson" class="z-txt easyui-autocomplete" data-options="url:'/api/mms/send/getdoperson'"/></div>
      
            <div class="clear"></div>
       
            <div class="grid_1 lbl">仓库</div>
            <div class="grid_2 val"><input type="text" data-bind="datasource:dataSource.warehouseItems ,comboboxValue:form.WarehouseCode" class="z-txt easyui-combobox" data-options="showblank:true"/></div>
            <div class="grid_1 lbl">计价方式</div>
            <div class="grid_2 val"><input type="text" data-bind="comboboxValue:form.PriceKind,datasource:dataSource.PriceKind" class="easyui-combobox z-txt" data-options="showblank:true" /></div>
            <div class="grid_1 lbl">领料日期</div>
            <div class="grid_2 val"><input type="text" data-bind="value:form.SendDate" class="z-txt easyui-daterange"/></div>

            <div class="clear"></div>

            <div class="prefix_9" style="position:absolute;top:5px;height:0;">  
                <a id="a_search" href="#" class="buttonHuge button-blue" style="margin:0 15px;" data-bind="click:searchClick">查询</a> 
                <a id="a_reset" href="#" class="buttonHuge button-blue" data-bind="click:clearClick">清空</a>
            </div>
        </div>
 
        <table data-bind="datagrid:grid">
             <thead>  
                <tr>  
                    <th field="BillNo"          @Html.HideColumn(Cols,"BillNo")         sortable="true" align="left"    width="90"  >发料单号   </th>  
                    <th field="DoPerson"        @Html.HideColumn(Cols,"DoPerson")       sortable="true" align="left"    width="60"  >经办人     </th>  
                    <th field="PickUnitName"    @Html.HideColumn(Cols,"PickUnitName")   sortable="true" align="left"    width="150"  >领料单位   </th>   
                    <th field="WarehouseName"   @Html.HideColumn(Cols,"WarehouseName")  sortable="true" align="left"    width="100" >仓库       </th>  
                    <th field="SendDate"        @Html.HideColumn(Cols,"SendDate")       sortable="true" align="center"  width="80"  formatter="com.formatDate"    >领料日期   </th>  
                    <th field="PriceKind"       @Html.HideColumn(Cols,"PriceKind")      sortable="true" align="center"  width="80"  formatter="com.formaterPriceKind"   >计价方式   </th>  
                    <th field="TotalMoney"      @Html.HideColumn(Cols,"TotalMoney")     sortable="true" align="right"   width="80"  formatter="com.formatMoney"   >金额 
                    <th field="Purpose"         @Html.HideColumn(Cols,"Purpose")        sortable="true" align="left"    width="100" formatter="com.formaterPurpose">用途       </th>       </th>  
                    <th field="Remark"          @Html.HideColumn(Cols,"Remark")         sortable="true" align="left"    width="150" >备注       </th>   
                </tr>                            
            </thead>      
        </table>
 